home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / pagepalette.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-07-05  |  4.2 KB  |  214 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. #ifndef SEITENPAL_H
  8. #define SEITENPAL_H
  9.  
  10. #include <QCheckBox>
  11. #include <QDialog>
  12. #include <QDragEnterEvent>
  13. #include <QDragLeaveEvent>
  14. #include <QDragMoveEvent>
  15. #include <QDropEvent>
  16. #include <QHBoxLayout>
  17. #include <QImage>
  18. #include <QKeyEvent>
  19. #include <QLabel>
  20. #include <QLayout>
  21. #include <QListWidget>
  22. #include <QMouseEvent>
  23. #include <QPixmap>
  24. #include <QPushButton>
  25. #include <QSplitter>
  26. #include <QTableWidget>
  27. #include <QTableWidgetItem>
  28. #include <QToolTip>
  29. #include <QVBoxLayout>
  30.  
  31.  
  32. class QEvent;
  33.  
  34.  
  35. #include "scribusapi.h"
  36. #include "scrpalettebase.h"
  37.  
  38. class ScribusView;
  39. class ScribusMainWindow;
  40. class PageLayouts;
  41.  
  42. class SCRIBUS_API SeItem : public QTableWidgetItem
  43. {
  44.  
  45. friend class PagePalette;
  46. friend class SeView;
  47.  
  48.  
  49. public:
  50.     SeItem(QString text, uint pgnr, const QPixmap& Pix);
  51.     ~SeItem() {};
  52.  
  53.     const QString& getPageName();
  54.     uint pageNumber;
  55.     
  56. protected:
  57.     QString pageName;
  58. };
  59.  
  60. class SCRIBUS_API SeList : public QListWidget
  61. {
  62. friend class PagePalette;
  63.  
  64.     Q_OBJECT
  65.  
  66. public:
  67.     SeList(QWidget* parent);
  68.     ~SeList() {};
  69.  
  70. private slots:
  71.     void toggleThumbnail();
  72.  
  73. signals:
  74.     //! Emitted when user requests/disables the thumbnais for master pages.
  75.     void thumbnailChanged();
  76.     void DelMaster(QString);
  77.  
  78. protected:
  79.     void mouseReleaseEvent(QMouseEvent *m);
  80.     void mousePressEvent(QMouseEvent* e);
  81.     void mouseMoveEvent(QMouseEvent* e);
  82.     virtual void keyPressEvent(QKeyEvent* e);    
  83.     
  84.     QPoint Mpos;
  85.     QListWidgetItem *CurItem;
  86.     bool Mpressed;
  87.     bool Thumb;
  88.  
  89. };
  90.  
  91. class SCRIBUS_API SeView : public QTableWidget
  92. {
  93.     Q_OBJECT
  94.     
  95. friend class PagePalette;
  96.  
  97. public:
  98.     SeView(QWidget* parent);
  99.     ~SeView() {};
  100.     void ClearPix();
  101.     int GetPage(int r, int c, bool *last);
  102.  
  103. public slots:
  104.     void ToggleNam();
  105.  
  106. signals:
  107.     void UseTemp(QString, int);
  108.     void NewPage(int, QString);
  109.     void movePage(int, int);
  110.     void Click(int, int, int);
  111.     void DelPage(int);
  112.  
  113. protected:
  114.     virtual void dropEvent(QDropEvent * e);
  115.     virtual void dragEnterEvent(QDragEnterEvent *e);
  116.     virtual void dragLeaveEvent(QDragLeaveEvent *e);
  117.     virtual void dragMoveEvent(QDragMoveEvent *e);
  118.     virtual void mouseReleaseEvent(QMouseEvent *m);
  119.     virtual void mousePressEvent(QMouseEvent* e);
  120.     virtual void mouseMoveEvent(QMouseEvent* e);
  121.     virtual void keyPressEvent(QKeyEvent* e);
  122.     
  123.     QPoint Mpos;
  124.     bool Mpressed;
  125.     bool Doppel;
  126.     bool Links;
  127.     bool Namen;
  128.     int MaxC;
  129.     int colmult;
  130.     int rowmult;
  131.     int coladd;
  132.     int rowadd;
  133.     int cols;
  134.     int firstP;
  135. };
  136.  
  137. class SCRIBUS_API TrashBin : public QLabel
  138. {
  139.     Q_OBJECT
  140.  
  141. public:
  142.     TrashBin( QWidget * parent );
  143.     ~TrashBin() {};
  144.     void dragEnterEvent( QDragEnterEvent *e );
  145.     void dragLeaveEvent( QDragLeaveEvent * );
  146.     void dropEvent( QDropEvent * e );
  147.  
  148. protected:
  149.     QPixmap Normal;
  150.     QPixmap Offen;
  151.     
  152. signals:
  153.     void DelPage(int);
  154.     void DelMaster(QString);
  155. };
  156.  
  157. class SCRIBUS_API PagePalette : public ScrPaletteBase
  158. {
  159.     Q_OBJECT
  160.  
  161. public:
  162.     PagePalette(QWidget* parent);
  163.     ~PagePalette() {};
  164.     
  165.     virtual void changeEvent(QEvent *e);
  166.     
  167.     //CB FIXME Put these in for now and hide the rest. What are these indicating?
  168.     const bool getNamen();
  169.     const bool getThumb();
  170.  
  171. public slots:
  172.     void setView(ScribusView *view);
  173.     void deleteMasterPage(QString tmp);
  174.     void pageView_movePage(int r, int c);
  175.     void pageView_gotoPage(int r, int c, int b);
  176.     void enablePalette(const bool);
  177.     void handlePageLayout(int layout);
  178.     void handleFirstPage(int fp);
  179.     //! Recreate master pages thumbnails (if it's set on)
  180.     void rebuildMasters();
  181.     //! Recreate common pages arrangement
  182.     void rebuildPages();
  183.     void Rebuild();
  184.     void markPage(uint nr);
  185.     void selMasterPage();
  186.     QPixmap CreateIcon(int nr, QPixmap pixin);
  187.     void languageChange();
  188.  
  189. signals:
  190.     void EditTemp(QString);
  191.     void gotoPage(int);
  192.  
  193. protected:
  194.     QVBoxLayout* PagePaletteLayout;
  195.     QHBoxLayout* Layout1;
  196.     QVBoxLayout* Layout2;
  197.     QVBoxLayout* Layout3;
  198.     
  199.     PageLayouts* pageLayout;
  200.     QSplitter* Splitter1;
  201.     QLabel* TextLabel1;
  202.     QLabel* TextLabel2;
  203.     TrashBin* Trash;
  204.     QList<SeItem*> pageList;
  205.     SeList* masterPageList;
  206.     SeView* pageView;
  207.     ScribusView *currView;
  208.     ScribusMainWindow *m_scMW;
  209.     QPixmap pix;
  210. //     DynamicTip* dynTip;
  211. };
  212.  
  213. #endif // SEITENPAL_H
  214.